<script type="text/javascript">
	

/*	递归思想	*/
function fun1(arr) {
	let res = arr.reduce(function(res, next){
		if(next instanceof Array) {
			return res.concat(fun1(next));
		} else {
			return res.concat(next);
		}
	}, [])
	return res;
}

let res = fun1([1, 2, [2, [4, 5, [6]]], 3]);
console.log(res);


</script>